package com.mpgame.core.status;

import com.fasterxml.jackson.databind.JsonNode;
import com.mpgame.core.model.Damage;
import com.mpgame.core.model.Monster;

public class ContinuousDamageStatus extends StatusBase {
    private Damage damage;
    public ContinuousDamageStatus(){
        super(StatusType.CONTINUOUS_DAMAGE, 0);
    }
    @Override
    protected void parseJson(JsonNode params){
        this.setRoundDuration(params.get("roundDuration").asInt());

        Damage dmg = Damage.parseFromJson(params.get("damage"));

        this.damage = dmg;
    }
    @Override
    protected void Take(Monster mOwner, Monster mOpponent){
        // 持续伤害：
        mOwner.takeHurt(this.damage);
    }
}
